#pragma once

#include "memdb/memdb.h"
#include <unordered_map>

namespace memdb {
namespace impl {
namespace mock {

class MockTables : public memdb::ITables {
public:
  typedef ITables::KeyType KeyType;
  typedef ITables::ValueType ValueType;
  typedef ITables::Iterator Iterator;

  MockTables() ;
  ~MockTables() override ;

  std::pair<std::error_code, ValueType> create(const KeyType & name) override ;

  std::error_code drop(const KeyType & name) override ;

  bool exists(const KeyType & name) const override ;

  std::optional<ValueType> get(const KeyType & name) const override ;

  size_t count() const override ;

  std::unique_ptr<Iterator> iterator() const override;

private:
  std::unordered_map<KeyType, ValueType> _tables;
}; 
   
}//namespace mock
}//namespace impl
}//namespace memdb
